Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging and pass environment variables to AWS Lambda #16

Merged
merged 7 commits into from
Jun 12, 2024
Merged

Conversation

kunduso
Copy link
Owner

@kunduso kunduso commented Jun 12, 2024

The changes in this PR closes #15 and closes #14

@kunduso kunduso self-assigned this Jun 12, 2024
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

github-actions bot commented Jun 12, 2024

💰 Infracost report

Monthly cost will not change

This comment will be updated when code changes.

Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.archive_file.python_file: Reading...
data.archive_file.python_file: Read complete after 0s [id=efca5ba5d15c470502277886d6f89aea9b62262c]
data.aws_caller_identity.current: Reading...
aws_cloudwatch_event_rule.lambda_trigger: Refreshing state... [id=lambda_trigger_rule]
aws_kms_key.encryption_rest: Refreshing state... [id=2a1a5666-dc36-41c2-ae8c-613b15dc1314]
aws_iam_role.lambda_role: Refreshing state... [id=app-7-lambda-role]
aws_signer_signing_profile.prod_sp: Refreshing state... [id=prod_sp_20240612135225904900000001]
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
aws_lambda_code_signing_config.signing_config: Refreshing state... [id=arn:aws:lambda:us-east-2:743794601996:code-signing-config:csc-0a606bb252e6f1448]
aws_kms_key_policy.encryption_rest_policy: Refreshing state... [id=2a1a5666-dc36-41c2-ae8c-613b15dc1314]
aws_kms_alias.encryption_rest: Refreshing state... [id=alias/lambda-app-7-at-rest]
aws_cloudwatch_log_group.lambda_log: Refreshing state... [id=/aws/lambda/app-7]
aws_ssm_parameter.parameter: Refreshing state... [id=/app-7]
aws_cloudwatch_log_stream.log_stream: Refreshing state... [id=app-7-lambda-log-stream]
aws_iam_policy.lambda_policy: Refreshing state... [id=arn:aws:iam::743794601996:policy/app-7-lambda-policy]
aws_lambda_function.lambda_run: Refreshing state... [id=app-7]
aws_iam_role_policy_attachment.lambda_policy_attachement: Refreshing state... [id=app-7-lambda-role-20240612123105679800000001]
aws_lambda_permission.allow_cloudwatch: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.lambda_target: Refreshing state... [id=lambda_trigger_rule-lambda_target]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda_run will be updated in-place
  ~ resource "aws_lambda_function" "lambda_run" {
        id                             = "app-7"
      ~ last_modified                  = "2024-06-12T13:52:28.000+0000" -> (known after apply)
      ~ source_code_hash               = "NTFp25PFL/eo3L2aze0dY/cM+BVOnmrJ1/SY7tbRREk=" -> "r/IEcoyUiZqdbjpfqNbrR03Z+f3qKrwjwkDn/9yI5Wo="
        tags                           = {}
        # (27 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: TFplan.JSON

To perform exactly these actions, run the following command to apply:
    terraform apply "TFplan.JSON"

Pushed by: @kunduso, Action: pull_request

Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan

terraform
data.archive_file.python_file: Reading...
data.archive_file.python_file: Read complete after 0s [id=efca5ba5d15c470502277886d6f89aea9b62262c]
data.aws_caller_identity.current: Reading...
aws_cloudwatch_event_rule.lambda_trigger: Refreshing state... [id=lambda_trigger_rule]
aws_iam_role.lambda_role: Refreshing state... [id=app-7-lambda-role]
aws_kms_key.encryption_rest: Refreshing state... [id=69fb1409-a0ff-4af3-a117-411415e331f9]
data.aws_caller_identity.current: Read complete after 0s [id=743794601996]
aws_kms_alias.encryption_rest: Refreshing state... [id=alias/lambda-app-7-at-rest]
aws_ssm_parameter.parameter: Refreshing state... [id=/app-7]
aws_kms_key_policy.encryption_rest_policy: Refreshing state... [id=69fb1409-a0ff-4af3-a117-411415e331f9]
aws_cloudwatch_log_group.lambda_log: Refreshing state... [id=/aws/lambda/app-7]
aws_cloudwatch_log_stream.log_stream: Refreshing state... [id=app-7-lambda-log-stream]
aws_iam_policy.lambda_policy: Refreshing state... [id=arn:aws:iam::743794601996:policy/app-7-lambda-policy]
aws_lambda_function.lambda_run: Refreshing state... [id=app-7]
aws_iam_role_policy_attachment.lambda_policy_attachement: Refreshing state... [id=app-7-lambda-role-20240612142004396100000002]
aws_lambda_permission.allow_cloudwatch: Refreshing state... [id=AllowExecutionFromCloudWatch]
aws_cloudwatch_event_target.lambda_target: Refreshing state... [id=lambda_trigger_rule-lambda_target]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_lambda_function.lambda_run will be updated in-place
  ~ resource "aws_lambda_function" "lambda_run" {
        id                             = "app-7"
      ~ last_modified                  = "2024-06-12T16:01:52.908+0000" -> (known after apply)
      ~ source_code_hash               = "NTFp25PFL/eo3L2aze0dY/cM+BVOnmrJ1/SY7tbRREk=" -> "r/IEcoyUiZqdbjpfqNbrR03Z+f3qKrwjwkDn/9yI5Wo="
        tags                           = {}
        # (27 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # aws_ssm_parameter.parameter will be updated in-place
  ~ resource "aws_ssm_parameter" "parameter" {
        id              = "/app-7"
      + insecure_value  = (known after apply)
        name            = "/app-7"
        tags            = {}
      ~ value           = (sensitive value)
      ~ version         = 2 -> (known after apply)
        # (8 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: TFplan.JSON

To perform exactly these actions, run the following command to apply:
    terraform apply "TFplan.JSON"

Pushed by: @kunduso, Action: pull_request

@kunduso kunduso merged commit 8082d1e into main Jun 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass variable values from Terraform to AWS Lambda function Add logging capability
1 participant